﻿<Window x:Class="ProjectEF6.Panel"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="User" Height="320" Width="448" ResizeMode="NoResize" WindowStartupLocation="CenterScreen">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="227*"/>
            <ColumnDefinition Width="78*"/>
            <ColumnDefinition Width="137*"/>
        </Grid.ColumnDefinitions>
        
        <TabControl x:Name="tabControl" HorizontalAlignment="Left" Height="289" VerticalAlignment="Top" Width="440" Grid.ColumnSpan="3">
            <TabItem x:Name="tabReservaties" Header="Reservations">
                <Grid Background="#FFE5E5E5">
                    <Grid.Resources>
                        <DataTemplate x:Key="reservationTemplate">
                            <TextBlock Text="{Binding Name}"/>
                        </DataTemplate>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="57*"/>
                        <ColumnDefinition Width="5*"/>
                    </Grid.ColumnDefinitions>
                    <ListBox ScrollViewer.VerticalScrollBarVisibility="Visible" ItemTemplate="{StaticResource reservationTemplate}" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" x:Name="listboxReservations" HorizontalAlignment="Left" Height="241" Margin="10,10,0,0" VerticalAlignment="Top" Width="172"/>
                    
                    <Label x:Name="lblCompany" Content="{Binding Id}" HorizontalAlignment="Left" Margin="277,10,0,0" VerticalAlignment="Top" Height="24" Width="146" Grid.ColumnSpan="2"/>
                    <Label x:Name="lblStartDate" ContentStringFormat="{}{0:dd-MM-yyyy HH:mm}" Content="{Binding StartDate}" HorizontalAlignment="Left" Margin="277,58,0,0" VerticalAlignment="Top" Height="24" Width="146" Grid.ColumnSpan="2"/>
                    <Label x:Name="lblEndDate" ContentStringFormat="{}{0:dd-MM-yyyy HH:mm}" Content="{Binding EndDate}" HorizontalAlignment="Left" Margin="277,82,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.ColumnSpan="2"/>
                    <Label x:Name="lblCompanyID" Content="{Binding Name}" HorizontalAlignment="Left" Margin="277,106,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.ColumnSpan="2"/>
                    <Label x:Name="lblLocation" Content="{Binding locationName}" HorizontalAlignment="Left" Margin="277,34,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.ColumnSpan="2"/>
                    <Label x:Name="lblCreateDate" ContentStringFormat="{}{0:dd-MM-yyyy HH:mm}" Content="{Binding CreateDate}" HorizontalAlignment="Left" Margin="277,130,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.ColumnSpan="2"/>

                    <Label Content="Reservation ID:" HorizontalAlignment="Left" Margin="187,10,0,0" VerticalAlignment="Top" Height="24" Width="90"/>
                    <Label Content="Start date:" HorizontalAlignment="Left" Margin="187,58,0,0" VerticalAlignment="Top" Height="24" Width="90"/>
                    <Label Content="End date:" HorizontalAlignment="Left" Margin="187,82,0,0" VerticalAlignment="Top" Height="24" Width="90"/>
                    <Label Content="Company:" HorizontalAlignment="Left" Margin="187,106,0,0" VerticalAlignment="Top" Height="24" Width="90"/>
                    <Label Content="Location:" HorizontalAlignment="Left" Margin="187,34,0,0" VerticalAlignment="Top" Height="24" Width="90"/>
                    <Label Content="Create Date:" HorizontalAlignment="Left" Margin="187,130,0,0" VerticalAlignment="Top" Height="24" Width="90"/>
                    <Button x:Name="btnDeleteReservation" Content="Delete Reservation" Margin="187,231,98,0" VerticalAlignment="Top" Click="btnDeleteReservation_Click"/>
                    <Button x:Name="btnEditReservation" Content="Edit Reservation" HorizontalAlignment="Left" Margin="306,231,0,0" VerticalAlignment="Top" Width="118" Grid.ColumnSpan="2" Click="btnEditReservation_Click"/>

                </Grid>
            </TabItem>
            <TabItem x:Name="tabNewReservation" Header="Nieuwe Reservatie">
                <Grid Background="#FFE5E5E5">
                         
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="16*"/>
                        <ColumnDefinition Width="201*"/>
                    </Grid.ColumnDefinitions>

                    <Label Content="Start date:" HorizontalAlignment="Left" Margin="24,98,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <Label Content="End date:" HorizontalAlignment="Left" Margin="24,133,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <Label Content="Company ID:" HorizontalAlignment="Left" Margin="24,161,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <Label Content="Location ID:" HorizontalAlignment="Left" Margin="24,63,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <xctk:DateTimePicker x:Name="datepickerStart" Grid.Column="1" Margin="119,92,55,139" />
                    <xctk:DateTimePicker x:Name="datepickerEnd" Grid.Column="1" Margin="119,127,55,104" />
                    <Button x:Name="btnCreateReservation" Content="Create Reservation" Grid.Column="1" HorizontalAlignment="Left" Margin="201,190,0,0" VerticalAlignment="Top" Width="146" Click="btnCreateReservation_Click"/>
                    <ComboBox x:Name="cmbLocation" Grid.Column="1" Margin="119,63,55,174"/>
                    <ComboBox x:Name="cmbCompany" Grid.Column="1" HorizontalAlignment="Left" Margin="119,162,0,0" VerticalAlignment="Top" Width="228"/>
                </Grid>

            </TabItem>
             
            <TabItem x:Name="tabCalendar" Header="Kalender">
                <Grid Background="#FFE5E5E5">
                    <Grid.Resources>
                        <DataTemplate x:Key="reservationTemplateC">
                            <!--<TextBlock Text="{Binding StartDate  EndDate}"/>-->
                            <TextBlock  TextAlignment="Center" x:Name="datToDat">
                                <TextBlock.Text>
                                    <MultiBinding StringFormat="{}{0:dd-MM-yyyy   HH:mm}   tot   {1:dd-MM-yyyy   HH:mm}">
                                        <Binding Path="StartDate" />
                                        <Binding Path="EndDate" />
                                    </MultiBinding>
                                </TextBlock.Text>
                            </TextBlock>
                        </DataTemplate>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="16*"/>
                        <ColumnDefinition Width="201*"/>
                    </Grid.ColumnDefinitions>
                    <Calendar x:Name="calendarReservations" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Grid.ColumnSpan="2" SelectedDatesChanged="calendarReservations_SelectedDatesChanged"/>
                    <ListBox HorizontalContentAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Visible" ItemTemplate="{StaticResource reservationTemplateC}" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" x:Name="listboxReservationsC"  Margin="10,188,10,10" Width="414" Grid.ColumnSpan="2"/>

                    <Label x:Name="lblCompanyC" Content="{Binding Id}" HorizontalAlignment="Left" Margin="252,15,0,0" VerticalAlignment="Top" Height="24" Width="146" Grid.Column="1"/>
                    <Label x:Name="lblStartDateC" ContentStringFormat="{}{0:dd-MM-yyyy HH:mm}" Content="{Binding StartDate}" HorizontalAlignment="Left" Margin="252,63,0,0" VerticalAlignment="Top" Height="24" Width="146" Grid.Column="1"/>
                    <Label x:Name="lblEndDateC" ContentStringFormat="{}{0:dd-MM-yyyy HH:mm}" Content="{Binding EndDate}" HorizontalAlignment="Left" Margin="252,87,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.Column="1"/>
                    <Label x:Name="lblCompanyIDC" Content="{Binding Name}" HorizontalAlignment="Left" Margin="252,111,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.Column="1"/>
                    <Label x:Name="lblLocationC" Content="{Binding locationName}" HorizontalAlignment="Left" Margin="252,39,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.Column="1"/>
                    <Label x:Name="lblCreateDateC" ContentStringFormat="{}{0:dd-MM-yyyy HH:mm}" Content="{Binding CreateDate}" HorizontalAlignment="Left" Margin="252,135,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.Column="1"/>
                    <Label Content="Reservation ID:" HorizontalAlignment="Left" Margin="162,15,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <Label Content="Start date:" HorizontalAlignment="Left" Margin="162,63,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <Label Content="End date:" HorizontalAlignment="Left" Margin="162,87,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <Label Content="Company:" HorizontalAlignment="Left" Margin="162,111,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <Label Content="Location:" HorizontalAlignment="Left" Margin="162,39,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>
                    <Label Content="Create Date:" HorizontalAlignment="Left" Margin="162,135,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.Column="1"/>

                </Grid>
            </TabItem>


            <TabItem x:Name="tabContracts" Header="Contracten">
                <Grid Background="#FFE5E5E5">
                    <Grid.Resources>
                        <DataTemplate x:Key="contractTemplate">
                            <!--<TextBlock Text="{Binding StartDate  EndDate}"/>-->
                            <TextBlock  TextAlignment="Center" x:Name="datToDatCon">
                                <TextBlock.Text>
                                    <MultiBinding StringFormat="{}{0:dd-MM-yyyy}   tot   {1:dd-MM-yyyy}">
                                        <Binding Path="StartDate" />
                                        <Binding Path="EndDate" />
                                    </MultiBinding>
                                </TextBlock.Text>
                            </TextBlock>
                        </DataTemplate>
                    </Grid.Resources>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="16*"/>
                        <ColumnDefinition Width="201*"/>
                    </Grid.ColumnDefinitions>
                    <ListBox HorizontalContentAlignment="Stretch" ScrollViewer.VerticalScrollBarVisibility="Visible" ItemTemplate="{StaticResource contractTemplate}" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" x:Name="listboxContracts"  Margin="11,10,9,139" Grid.ColumnSpan="2"/>

                    <Label x:Name="lblIdCon" Content="{Binding Id}" HorizontalAlignment="Left" Margin="90,131,0,0" VerticalAlignment="Top" Height="24" Width="146" Grid.Column="1"/>
                    <Label x:Name="lblStartDateCon" ContentStringFormat="{}{0:dd-MM-yyyy HH:mm}" Content="{Binding StartDate}" HorizontalAlignment="Left" Margin="90,155,0,0" VerticalAlignment="Top" Height="24" Width="146" Grid.Column="1"/>
                    <Label x:Name="lblEndDateCon" ContentStringFormat="{}{0:dd-MM-yyyy HH:mm}" Content="{Binding EndDate}" HorizontalAlignment="Left" Margin="90,179,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.Column="1"/>
                    <Label x:Name="lblCompanyIDCon" Content="{Binding CompanyId}" HorizontalAlignment="Left" Margin="90,203,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.Column="1"/>
                    <Label x:Name="lblContractFormulaCon" Content="{Binding ContractFormulaId}" HorizontalAlignment="Left" Margin="89,227,0,0" VerticalAlignment="Top" Height="24" Width="147" Grid.Column="1"/>
                    <Label Content="Contract ID:" HorizontalAlignment="Left" Margin="13,131,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.ColumnSpan="2"/>
                    <Label Content="Start date:" HorizontalAlignment="Left" Margin="13,155,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.ColumnSpan="2"/>
                    <Label Content="End date:" HorizontalAlignment="Left" Margin="13,179,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.ColumnSpan="2"/>
                    <Label Content="Company:" HorizontalAlignment="Left" Margin="13,203,0,0" VerticalAlignment="Top" Height="24" Width="90" Grid.ColumnSpan="2"/>
                    <Label Content="Contract Forumla:" HorizontalAlignment="Left" Margin="13,227,0,0" VerticalAlignment="Top" Height="24" Width="103" Grid.ColumnSpan="2"/>
                    <Button x:Name="btnStopContract" Content="Stop Contract" Grid.Column="1" HorizontalAlignment="Left" Margin="241,127,0,0" VerticalAlignment="Top" Width="151" Click="btnStopContract_Click"/>

                </Grid>
            </TabItem>
        </TabControl>

    </Grid>
</Window>
